package com.firegod.servicebase.dao;

import com.firegod.servicebase.entity.Course;
import com.firegod.servicebase.entity.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TeacherRepository extends JpaRepository<Teacher, Long>, JpaSpecificationExecutor<Teacher> {
    Teacher getByUserId(String userId);

    @Query(value = "select t.courseList from Teacher t")
    List<Course> getCourseListByUserId(String userId);
}
